package com.kidedu.action;

import java.util.List;

import org.apache.struts2.ServletActionContext;

import com.kidedu.entity.dto.KClassDTO;
import com.kidedu.service.IKClassService;
import com.kidedu.util.SpringContextUtil;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;

public class KClassIntroAction {
	private String sort;
	
	private List<KClassDTO> kClassList;
	
	private IKClassService ikClassService = (IKClassService) SpringContextUtil.getBean("iKClassService");
	
	public String index(){
		ActionContext.getContext().getSession().put("ctx", ServletActionContext.getServletContext().getContextPath());
		return Action.SUCCESS;
	}
	
	public String getClassList(){
		kClassList = ikClassService.getClassList(sort);
		return "JSON";
	}

	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}

	public List<KClassDTO> getkClassList() {
		return kClassList;
	}

	public void setkClassList(List<KClassDTO> kClassList) {
		this.kClassList = kClassList;
	}
}
